'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1536300167705_4441';

  // add your config here
  config.middleware = [];

  // 单数据库信息配置
  config.mysql = {
    client: {
      host: 'localhost',
      port: '3306',
      user: 'sun',
      password: '123456',
      database: 'egg',
    },
    app: true,
    agent: false,
  };

  //在config.{env}.js中配置，注意配置覆盖的问题
  config.security = {
    csrf: {
      enable: false,
      // ignoreJSON: true
    },
    domainWhiteList:['*'],
  };

  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
  };



  config.api = "http://127.0.0.1:7001"
  return config;
};